
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Square.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Square)
{
 
       TEST(should be able to calculate area : area(3.45))
        {
                Square square(3.45);
                ASSERT_EQ(true, (square.getArea () - 11.90 < 0.01));
        } 

        TEST(should be able to calculate perimeter : perimeter(3.45))
        {
                Square square(2);
                ASSERT_EQ(true, (square.getPerimeter () - 13.8 < 0.01));
        }

        TEST(should be able to set valid side length)
        {
                Square square(2);
                ASSERT_EQ(true, (square.setSide (4.5)));
        }

        TEST(should be able to refuse invalid side length)
        {
                Square square(3.45);
                float area = square.getArea();

                ASSERT_EQ(false, (square.setSide (101)));
                ASSERT_EQ(true, (area == square.getArea()));
        }
};
